package com.horay.springbootdemo.caffeine.redis.userinfo.controller;

import com.horay.springbootdemo.caffeine.redis.userinfo.service.UserInfoService;
import com.horay.springbootdemo.common.model.UserInfo;
import com.horay.springbootdemo.common.result.ResultBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户信息控制器
 *
 * @author heyingcheng
 * @date 2019/9/30 17:33
 */
@RestController
@RequestMapping("userinfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    @PostMapping("add")
    public ResultBody<String> add(@RequestBody UserInfo userInfo) {
        return ResultBody.success(userInfoService.registerUser(userInfo));
    }

}
